﻿// See https://aka.ms/new-console-template for more information
using System.Numerics;

class Program
{
    static void Main()
    {
        int[] a = new int[100];
        Random random = new Random(1000);
        for (int i = 0; i < 100; i++)
        {
            a[i] = random.Next(0,1001);

        }
        var sortedArray = a.OrderByDescending(x => x).ToArray();
        int sum = sortedArray.Sum();
        double average = sortedArray.Average();
        Console.WriteLine("排序后：");
        foreach (var number in sortedArray)
        {
            Console.Write(number + " ");
        }

        Console.WriteLine($"\n总和：{sum}");
        Console.WriteLine($"平均数：{average}");
    }

}

